package com.miage.bdd;

import com.miage.utils.Constante;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class BaseSQLite extends SQLiteOpenHelper {

	public BaseSQLite(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(Constante.EVENEMENT_TABLE_CREATE);
		db.execSQL(Constante.DEPENSE_TABLE_CREATE);
		db.execSQL(Constante.PARTICIPANT_TABLE_CREATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL(Constante.EVENEMENT_TABLE_DROP);
		db.execSQL(Constante.DEPENSE_TABLE_DROP);
		db.execSQL(Constante.PARTICIPANT_TABLE_DROP);
		onCreate(db);
	}
	
	
	

}
